package com.qidian.mes.md.service.impl;

import com.qidian.mes.md.mapper.MdDeptResourcesMapper;
import com.qidian.mes.md.service.MdDeptResourceService;
import com.qidian.mes.md.vo.MdDeptResourceVO;
import com.qidian.mes.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: CoolPro
 * @Description:
 * @Time: 2024-04-11 16:10
 **/
@Service
public class MdDeptResourceServiceImpl implements MdDeptResourceService {

    @Autowired
    private MdDeptResourcesMapper mdDeptResourcesMapper;

    @Override
    public QdResult getDeptResources(Integer idWork) {
        return QdResult.success(mdDeptResourcesMapper.getDeptResources(idWork));
    }

    @Override
    public QdResult insertDeptResources(MdDeptResourceVO mdDeptResourceVO) {
        mdDeptResourcesMapper.insertDeptResources(mdDeptResourceVO);
        return QdResult.success("插入成功");
    }

    @Override
    public QdResult deleteDeptResources(MdDeptResourceVO mdDeptResourceVO) {
        mdDeptResourcesMapper.deleteDeptResources(mdDeptResourceVO);
        return QdResult.success("删除成功");
    }

    @Override
    public QdResult updateDeptResources(MdDeptResourceVO mdDeptResourceVO) {
        mdDeptResourcesMapper.updateDeptResources(mdDeptResourceVO);
        return QdResult.success("修改成功");

    }

    @Override
    public QdResult getDeptsByName(String name) {
        return QdResult.success(mdDeptResourcesMapper.getDeptByName(name));
    }


}
